#ifndef DELIVERYACTIONLISTENER_H
#define DELIVERYACTIONLISTENER_H
#include <iostream>
#include <atomic>
#include "token.h"
#include "actionlisten.h"

class DeliveryActionListener : public ActionListen
{
public:
    DeliveryActionListener();

    bool is_done() const
    {
        return done_;
    }

private:

    void on_failure(const mqtt::token& tok) override
    {
        ActionListen::on_failure(tok);
        done_ = true;
    }

    void on_success(const mqtt::token& tok) override
    {
        ActionListen::on_success(tok);
        done_ = true;
    }

	std::atomic<bool> done_;
};

#endif // DELIVERYACTIONLISTENER_H
